<?php
	require_once($_SERVER["DOCUMENT_ROOT"] .'Teste/Utils/Utils.class.php');
	class DbConnection extends Utils{
		private static $user = "root";
		private static $pass = "";
		private static $host = "localhost";
		private static $dbName = "bdTeste";

		public function __construct(){

		}

		protected static function connect(){
			$conectionString = "mysql:host=".self::$host.";dbname=".self::$dbName;		
			return new PDO($conectionString, self::$user,self::$pass);
		}

		public static function prepareStmt($sql){
			return  self::connect()->prepare($sql);
		}

		public static function runQuery($stm){
			return $stm->execute();
		}

		public static function runSelect($stm){
			$stm->execute();
			return $stm->fetchAll(PDO::FETCH_ASSOC);
		}

	}
?>